<html>
<head><meta charset="utf-8"><title>More edition ideas: better-restrict packed structs? · t-lang · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/index.html">t-lang</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/More.20edition.20ideas.3A.20better-restrict.20packed.20structs.3F.html">More edition ideas: better-restrict packed structs?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="217194422"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/More%20edition%20ideas%3A%20better-restrict%20packed%20structs%3F/near/217194422" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/More.20edition.20ideas.3A.20better-restrict.20packed.20structs.3F.html#217194422">(Nov 18 2020 at 20:47)</a>:</h4>
<p>Someone just brought this up over in the unsafe code WG, and now that we have <code>ptr::raw_const!</code> and friends, these things seem like they'd be good candidates for transitioning to hard errors, at least in the edition if not everywhere:</p>
<div class="codehilite"><pre><span></span><code>warning: `#[derive]` can&#39;t be used on a `#[repr(packed)]` struct that does not derive Copy (error E0133)
 --&gt; src/lib.rs:1:10
  |
1 | #[derive(Hash)]
  |          ^^^^
  |
  = note: `#[warn(safe_packed_borrows)]` on by default
  = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
  = note: for more information, see issue #46043 &lt;https://github.com/rust-lang/rust/issues/46043&gt;
</code></pre></div>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>